package com.fhz.a1909.work;

import android.content.Context;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.work.Worker;
import androidx.work.WorkerParameters;

import com.fhz.a1909.R;

/**
 * 时间:2022/3/23
 *
 * @author msfeng
 * 简述: TODO
 */
public class MyWork extends Worker {
    private static final String TAG = "work";
    public MyWork(@NonNull Context context, @NonNull WorkerParameters workerParams) {
        super(context, workerParams);
    }

    @NonNull
    @Override
    public Result doWork() {
        Log.i(TAG, "doWork: ");

        String xiaoming = getInputData().getString("xiaoming");
        Log.i(TAG, "doWork: "+xiaoming);
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return Result.success();
    }
}

